<?php
namespace app\login\model;
use think\Model;
use think\Db;
class Login extends Model
{

    public function login($data){
        $captcha = new \think\captcha\Captcha();
        
        $user=Db::name('user')->where('username','=',$data['username'])->find();
        if($user){
            if($user['password'] ==$data['password']sss){
                session('username',$user['username']);
                session('uid',$user['id']);
                return 3; //信息正确
            }else{
                return 2; //密码错误
            }
        }else{
            return 1; //用户不存在
        }
    }

}
